package com.memory.ui;

import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;


public class SplashScreen extends Activity {
	private final int SPLASH_DELAY_TIME = 3000;
	private Handler displayHomeHandler;
	private Runnable displayHomeRunnable;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splashscreen);
		displayHomeHandler = new Handler();
		displayHomeRunnable = new Runnable() {
			@Override
			public void run() {
				// TODO Auto-generated method stub
				displayHome();
			}
		};
		
		displayHomeHandler.postDelayed(displayHomeRunnable, SPLASH_DELAY_TIME);
	}

	private void displayHome() {
		Intent intent = new Intent(this, NextTile.class);
		startActivity(intent);
		finish();
	}


	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		displayHomeHandler.removeCallbacks(displayHomeRunnable);
		super.onDestroy();
	}

	
}